# run setup
source("setup.R")
# load data
ww1 = readRDS(fs::path("../",controls$savepoint,"ww1.rds"))
shapes = readRDS(fs::path("../",controls$savepoint,"shapes.rds"))

We use measurements of SARS-CoV-2 concentration in wastewater from multiple ARAs in Switzerland in 2022 and 2023. Viral concentration (C, unit: gene copies [gc] per liter) is transformed into viral load (V; unit: gc per day per 100,000) using the flow of wastewater on the same day (F) and the size of the population covered (P): \[ V = \frac{C \times F}{P/100,000} \] Table 1 provides a summary of the available data. Reporting frequencies and periods depended on the ARA, with daily measurements for the full period only available in a few cases (Figure 1). ARAs also sent their samples to different laboratories. In some cases, there were also changes in the method used. SARS-CoV-2 could be detected in the wastewater in most cases, with a few occurrences of no detection (Figure 2). Viral load varied over time, with large heterogeneity across ARAs, although some patterns emerge on visual inspection (Figure 3).

Table 1. Summary of available data.

mw_100_desc_table(ww1) %>% 
  dplyr::mutate(across(everything(),as.character)) %>% 
  tidyr::gather() %>% 
  flextable::flextable(cwidth=c(3,4)) 

key

value

Number of ARAs

112

Number of laboratories

9

Number of measurements

19392

First

2022-02-07

Last

2023-05-07

Viral concentration [gc/L]

1e+05 (range: 0 to 8e+06)

Flow [m3/day]

1e+04 (range: 3e+02 to 8e+05)

Viral load [gc/day/100,000]

4e+12 (range: 0 to 7e+14)

mw_101_fig_missing(ww1)

Figure 1. Available measurements over time by ARA (grouped by canton).

mw_110_map_missing(ww1,shapes)

Figure 2. Total measurements by ARA.

mw_103_fig_detect(ww1,detect_limit=0) # TODO: replace by something based on LOQ/LOD

Figure 3. SARS-CoV-2 detection in wastewater over time by ARA.

mw_104_fig_vl(ww1,lower_limit=1e4)

Figure 4. Weekly mean SARS-CoV-2 viral load in wastewater by ARA (removing one outlier). Dashed lines show the delimitation in four periods.

mw_111_map_vl(ww1,shapes,lower_limit=1e4)

Figure 5. Mean SARS-CoV-2 viral load in wastewater by ARA by period.

if(FALSE) {
  ggplot(ww1) +
    geom_point(aes(x=pop,y=pop_total)) +
    geom_abline(intercept=0,slope=1)
  
  dd = ww1 %>% 
    group_by(ara_id,ara_name) %>% 
    summarise(pop=max(pop),
              pop_total=max(pop_total)) %>% 
    mutate(rel=(pop_total-pop)/pop,
           abs=pop-pop_total) %>% 
    arrange(-abs(rel))
  ggplot(dd) +
    geom_point(aes(x=ara_name,y=pop),colour="firebrick")+
    geom_point(aes(x=ara_name,y=pop_total),colour="dodgerblue",shape=1) +
    scale_x_discrete(limits=rev) +
    coord_flip() +
  theme(axis.text = element_text(size=5))
}